<{include file="Public/top.html" }>
	</head>
	<body>
		<div id="warpper">
            <div class="content">
                <div class="location">用户操作</div>
                <!-- 子导航 -->
                <{include file="./nav.html" }>

                <form method="post" class="ui-form" id="addManagerForm">
                <div class="filedSet">
                    <div class="topic">发送短信</div>
                    <div class="form-box border0 border-box">

                            <div class="ui-form-item" style="height:175px;">
                                <label class="ui-label">用户手机：</label>
                                <textarea class="ui-textarea" id="phone" name="phone" placeholder="13174128523,13174128523,13174128523"></textarea>
                                <span class="inline-block notes">多个手机<br>使用“,”分割</span><br>
                                <label class="ui-label" style="padding-left:120px; width:70px;">全员发送</label>
                                <input id="allUser" type="checkbox" value="1" name="all"/>
                            </div>
                            <div class="ui-form-item" style="height:140px;">
                                <label class="ui-label">用户信息：</label>
                                <textarea class="ui-textarea" id="content" name="content" placeholder="您获得了xxxxx,请准时出席" required></textarea>
                                <span class="inline-block notes">会自动替换成用户真实姓名,如没有真实姓名则为空</span>
                            </div>

                    </div>
                </div>
                <div class="integral_btn-group">
                    <input type="submit" value="提交" class="ui-button"/>
                </div>
                </form>
            </div>
		</div>

        <{include file="Public/foot.html" }>
		<script>

            var SMSEditURL = "<{u('User/sendSms')}>";

			$(function(){
                $('#pointAdd').on('change',function(){
                    if($('#pointAdd').val().length>0){
                        $('#pointReduce').val('').attr('required',false)
                    }
                });
                $('#pointReduce').on('change',function(){
                    if($('#pointReduce').val().length>0){
                        $('#pointAdd').val('').attr('required',false)
                    }
                });


                $("form").submit(function () {
                    if( !$("#content").val() ){
                        layer.msg('请填写内容！');
                        return false;
                    }
                    $.getJSON(SMSEditURL,$(this).serialize(), function(data){
                        if(data.status!=0){
                            layer.msg(data.msg);
                            return false;
                        }else{
                            layer.msg(data.msg);
                        }
                    });
                    return false;
                });



			});


            $('#allUser').on('ifChecked',function(){
                $('#uid').attr('disabled',true);
                $('#pointReduce').attr('disabled',true);

            }).on('ifUnchecked',function(){
                $('#uid').attr('disabled',false);
                $('#pointReduce').attr('disabled',false);
            });


		</script>
	</body>
</html>
